﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Configuration;
using System;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
using System.Web.UI.WebControls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

public partial class admin_report_property_for_rent : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (Session["email"] == null)
        {
            Session["email"] = "admin";
        }
        Label2.Text = Session["email"].ToString();
        if (Page.IsPostBack)
        {
        }
        else
        {
            //{
            //    GridView2.Visible = true;
            //    GridView1.Visible = false;
        }
    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        // GridView1.Visible = true;
    }
    protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
    {
        //   GridView1.Visible = true;
    }
    protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e)
    {

        // GridView1.Visible = true;
    }
    protected void DropDownList5_SelectedIndexChanged(object sender, EventArgs e)
    {
        //  GridView1.Visible = true;
    }
    protected void DropDownList6_SelectedIndexChanged(object sender, EventArgs e)
    {
        // GridView1.Visible = true;

    }
    protected void DropDownList7_SelectedIndexChanged(object sender, EventArgs e)
    {
        //   GridView1.Visible = true;

    }
    protected void DropDownList8_SelectedIndexChanged(object sender, EventArgs e)
    {
        //  GridView1.Visible = true;

    }
    protected void DropDownList9_SelectedIndexChanged(object sender, EventArgs e)
    {
        // GridView1.Visible = true;
    }
    protected void DropDownList10_SelectedIndexChanged(object sender, EventArgs e)
    {
        //GridView1.Visible = true;
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Session.Abandon();
        Response.Redirect("../admin.aspx");
    }


    //protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    //{
    //    if (e.CommandName == "action")
    //    {

    //        //Label1.Text = "hello";
    //        int index = Convert.ToSByte(e.CommandArgument);

    //        GridViewRow row = GridView1.Rows[index];
    //        SqlDataAdapter adp = new SqlDataAdapter();
    //        SqlCommand cmd1 = new SqlCommand();
    //        DataSet ds = new DataSet();


    //        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Connstr"].ConnectionString);

    //        con.Open();

    //        SqlCommand objectvalue = new SqlCommand("", con);
    //        cmd1.Connection = con;

    //        SqlCommand dmc = new SqlCommand("Delete from properties_rent where p_id='" + row.Cells[0].Text + "'", con);
    //        dmc.ExecuteNonQuery();

    //        // SqlCommand dmc = new SqlCommand("select p_id from properties where p_id='" + row.Cells[0].Text + "'", con);

    //        //dmc.ExecuteNonQuery();
    //        //  Session["p_id"] = row.Cells[0].Text;

    //        con.Close();
    //        // Response.Write(Session["p_id"]);
    //        // Response.Write(@"<script language='javascript'>alert('clent has been selected')</script>");

    //        Response.Redirect("report_property_for_rent.aspx");
    //        // con.Close();


    //    }



    //    if (e.CommandName == "view")
    //    {

    //        //Label1.Text = "hello";
    //        int index = Convert.ToSByte(e.CommandArgument);

    //        GridViewRow row = GridView1.Rows[index];
    //        SqlDataAdapter adp = new SqlDataAdapter();
    //        SqlCommand cmd1 = new SqlCommand();
    //        DataSet ds = new DataSet();


    //        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Connstr"].ConnectionString);

    //        con.Open();

    //        SqlCommand objectvalue = new SqlCommand("", con);
    //        cmd1.Connection = con;



    //        SqlCommand dmc = new SqlCommand("select p_id from properties_rent where p_id='" + row.Cells[0].ToString () + "'", con);

    //        dmc.ExecuteNonQuery();
    //        Session["p_id"] = row.Cells[0].Text.ToString();

    //        con.Close();
    //        // Response.Write(Session["p_id"]);
    //        // Response.Write(@"<script language='javascript'>alert('clent has been selected')</script>");

    //        Response.Redirect("to-rentupdate.aspx");
    //        // con.Close();


    //    }

    //}


    //protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
    //{

    //    if (e.CommandName == "action")
    //    {

    //        //Label1.Text = "hello";
    //        int index = Convert.ToSByte(e.CommandArgument);

    //        GridViewRow row = GridView2.Rows[index];
    //        SqlDataAdapter adp = new SqlDataAdapter();
    //        SqlCommand cmd1 = new SqlCommand();
    //        DataSet ds = new DataSet();


    //        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Connstr"].ConnectionString);

    //        con.Open();

    //        SqlCommand objectvalue = new SqlCommand("", con);
    //        cmd1.Connection = con;

    //       SqlCommand dmc = new SqlCommand("Delete from properties_rent where p_id='" + row.Cells[0].Text + "'", con);
    //        dmc.ExecuteNonQuery();

    //        SqlCommand dmc1 = new SqlCommand("Delete from images_torent where p_id='" + row.Cells[0].Text + "'", con);
    //        dmc1.ExecuteNonQuery(); 

    //        // SqlCommand dmc = new SqlCommand("select p_id from properties where p_id='" + row.Cells[0].Text + "'", con);

    //        //dmc.ExecuteNonQuery();
    //        //  Session["p_id"] = row.Cells[0].Text;

    //        con.Close();
    //        // Response.Write(Session["p_id"]);
    //        // Response.Write(@"<script language='javascript'>alert('clent has been selected')</script>");

    //        Response.Redirect("report_property_for_rent.aspx");
    //        // con.Close();


    //    }

    //    if (e.CommandName == "view")
    //    {

    //        //Label1.Text = "hello";
    //        int index = Convert.ToSByte(e.CommandArgument);

    //        GridViewRow row = GridView2.Rows[index];
    //        SqlDataAdapter adp = new SqlDataAdapter();
    //        SqlCommand cmd1 = new SqlCommand();
    //        DataSet ds = new DataSet();


    //        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Connstr"].ConnectionString);

    //        con.Open();

    //        SqlCommand objectvalue = new SqlCommand("", con);
    //        cmd1.Connection = con;



    //        SqlCommand dmc = new SqlCommand("select p_id from properties_rent where p_id='" + row.Cells[0].Text + "'", con);

    //        dmc.ExecuteNonQuery();
    //        Session["p_id"] = row.Cells[0].Text.ToString();

    //        con.Close();
    //        // Response.Write(Session["p_id"]);
    //        // Response.Write(@"<script language='javascript'>alert('clent has been selected')</script>");

    //        Response.Redirect("to-rentupdate.aspx");
    //        // con.Close();


    //    }

    //}
    protected void Button1_Click(object sender, System.EventArgs e)
    {
        //GridView1.Visible = true;
        //GridView2.Visible = false;

    }

    protected void Button2_Click(object sender, System.EventArgs e)
    {
        Response.Redirect("to_rent.aspx");
    }
}

//protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
//{

//}
